this.BX=this.BX||{};(function(e,t,n,i,s){"use strict";let o=e=>e,a,l,r,c,d,p,u,b;var g=babelHelpers.classPrivateFieldLooseKey("cache");var h=babelHelpers.classPrivateFieldLooseKey("getPopup");var v=babelHelpers.classPrivateFieldLooseKey("getContent");class k extends t.EventEmitter{constructor(e){super();Object.defineProperty(this,v,{value:T});Object.defineProperty(this,h,{value:f});Object.defineProperty(this,g,{writable:true,value:new n.Cache.MemoryCache});this.setEventNamespace("BX.Landing.FeaturesPopup");this.subscribeFromOptions(e.events);this.setOptions(e);n.Event.bind(s.PageObject.getEditorWindow().document,"click",(()=>{this.hide()}))}setOptions(e){babelHelpers.classPrivateFieldLooseBase(this,g)[g].set("options",{...e})}getOptions(){return babelHelpers.classPrivateFieldLooseBase(this,g)[g].get("options",{})}show(){babelHelpers.classPrivateFieldLooseBase(this,h)[h]().show();this.emit("onShow")}hide(){babelHelpers.classPrivateFieldLooseBase(this,h)[h]().close();this.emit("onClose")}isShown(){return babelHelpers.classPrivateFieldLooseBase(this,h)[h]().isShown()}static createContentBlock(e){if(n.Type.isArray(e)){return e.map((e=>k.createContentBlock(e)))}const t=()=>{if(n.Type.isStringFilled(e.title)){return n.Tag.render(a||(a=o`
					<div class="landing-features-popup-content-block-text-title">
						${0}
					</div>
				`),n.Text.encode(e.title))}return""};const i=()=>{if(n.Type.isPlainObject(e.link)&&n.Type.isStringFilled(e.link.label)&&n.Type.isFunction(e.link.onClick)){return n.Tag.render(l||(l=o`
					<div 
						class="landing-features-popup-content-block-text-link"
						onclick="${0}"
					>
						${0}
					</div>
				`),e.link.onClick,n.Text.encode(e.link.label))}return""};const s=()=>{if(n.Type.isPlainObject(e.actionButton)&&n.Type.isStringFilled(e.actionButton.label)&&n.Type.isFunction(e.actionButton.onClick)){return n.Tag.render(r||(r=o`
					<div class="landing-features-popup-content-block-action">
						<span 
							class="ui-btn ui-btn-xs ui-btn-round ui-btn-no-caps ui-btn-light-border"
							onclick="${0}"
						>${0}</span>
					</div>
				`),e.actionButton.onClick,n.Text.encode(e.actionButton.label))}return""};const u=()=>{const e=t();const s=i();if(e||s){return n.Tag.render(c||(c=o`
					<div class="landing-features-popup-content-block-text">
						${0}
						${0}
					</div>
				`),t(),i())}return""};const b=()=>{if(n.Type.isPlainObject(e.icon)){return n.Tag.render(d||(d=o`
					<div class="landing-features-popup-content-block-icon">
						<div class="ui-icon ui-icon-md ${0}">
							<i></i>
						</div>
					</div>
				`),e.icon.className)}return""};const g=(()=>{let t="";if(n.Type.isFunction(e.onClick)){t+=" landing-features-popup-content-block-clickable"}if(n.Type.isStringFilled(e.theme)){t+=` landing-features-popup-content-block-theme-${e.theme}`}return t})();const h=n.Tag.render(p||(p=o`
			<div 
				class="landing-features-popup-content-block${0}"
				data-id="${0}"
			>
				${0}
				${0}
				${0}
			</div>
		`),g,n.Text.encode(e.id||n.Text.getRandom()),b(),u(),s());if(n.Type.isFunction(e.onClick)){n.Event.bind(h,"click",e.onClick)}if(n.Type.isStringFilled(e.backgroundColor)){n.Dom.style(h,"background-color",e.backgroundColor)}return h}static createRow(e){return n.Tag.render(u||(u=o`
			<div class="landing-features-popup-content-row">
				${0}
			</div>
		`),k.createContentBlock(e))}}function f(){return babelHelpers.classPrivateFieldLooseBase(this,g)[g].remember("popup",(()=>new i.Popup({id:`landing-features-popup-${n.Text.getRandom()}`,bindElement:this.getOptions().bindElement,content:babelHelpers.classPrivateFieldLooseBase(this,v)[v](),className:"landing-features-popup",width:410,autoHide:true,closeByEsc:true,noAllPaddings:true,angle:{position:"top",offset:115},minWidth:410,contentBackground:"transparent",background:"#E9EAED"})))}function T(){return babelHelpers.classPrivateFieldLooseBase(this,g)[g].remember("content",(()=>n.Tag.render(b||(b=o`
				<div class="landing-features-popup-content">
					${0}
				</div>
			`),this.getOptions().items.map((e=>k.createRow(e))))))}k.Themes={Highlight:"highlight"};e.FeaturesPopup=k})(this.BX.Landing=this.BX.Landing||{},BX.Event,BX,BX.Main,BX.Landing);
//# sourceMappingURL=features-popup.bundle.map.js